package com.yinhe.system.service.impl;

import java.util.List;

import com.yinhe.common.annotation.DataScope;
import com.yinhe.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yinhe.system.mapper.YhFoundationsMapper;
import com.yinhe.system.domain.YhFoundations;
import com.yinhe.system.service.IYhFoundationsService;

/**
 * 技术基础Service业务层处理
 * 
 * @author yinhe
 * @date 2022-09-24
 */
@Service
public class YhFoundationsServiceImpl implements IYhFoundationsService 
{
    @Autowired
    private YhFoundationsMapper yhFoundationsMapper;

    /**
     * 查询技术基础
     * 
     * @param id 技术基础主键
     * @return 技术基础
     */
    @Override
    public YhFoundations selectYhFoundationsById(Long id)
    {
        return yhFoundationsMapper.selectYhFoundationsById(id);
    }

    /**
     * 查询技术基础列表
     * 
     * @param yhFoundations 技术基础
     * @return 技术基础
     */

    @Override
    @DataScope(deptAlias = "yh_foundations", userAlias = "yh_foundations")
    public List<YhFoundations> selectYhFoundationsList(YhFoundations yhFoundations)
    {
        return yhFoundationsMapper.selectYhFoundationsList(yhFoundations);
    }

    /**
     * 新增技术基础
     * 
     * @param yhFoundations 技术基础
     * @return 结果
     */
    @Override
    public int insertYhFoundations(YhFoundations yhFoundations)
    {
        yhFoundations.setCreateTime(DateUtils.getNowDate());
        return yhFoundationsMapper.insertYhFoundations(yhFoundations);
    }

    /**
     * 修改技术基础
     * 
     * @param yhFoundations 技术基础
     * @return 结果
     */
    @Override
    public int updateYhFoundations(YhFoundations yhFoundations)
    {
        yhFoundations.setUpdateTime(DateUtils.getNowDate());
        return yhFoundationsMapper.updateYhFoundations(yhFoundations);
    }

    /**
     * 批量删除技术基础
     * 
     * @param ids 需要删除的技术基础主键
     * @return 结果
     */
    @Override
    public int deleteYhFoundationsByIds(Long[] ids)
    {
        return yhFoundationsMapper.deleteYhFoundationsByIds(ids);
    }

    /**
     * 删除技术基础信息
     * 
     * @param id 技术基础主键
     * @return 结果
     */
    @Override
    public int deleteYhFoundationsById(Long id)
    {
        return yhFoundationsMapper.deleteYhFoundationsById(id);
    }
}
